
import GlobalEvent from "../../../cfw/event/GlobalEvent";
import { EventName } from "../../../public/Config";
import CookeryRoomStep from "./CookeryRoomStep";
const { ccclass, property } = cc._decorator;

@ccclass
export default class CookeryRoomStep4 extends CookeryRoomStep {

    @property(cc.Node)
    handle: cc.Node = null;


    @property(cc.Node)
    blink: cc.Node = null;

    start() {
        this.node.active = true;
        cc.tween(this.handle).to(3, { angle: -90 }).call(this.finish.bind(this)).start();
        this.blink.opacity = 0;
        cc.tween(this.blink).repeat(3, cc.tween(this.blink).to(0.5, { opacity: 255 }).to(0.5, { opacity: 0 })).start();
    }


    finish() {
        cc.log(' finish == ')
        GlobalEvent.instance().emit(EventName.UPDATE_COOKIE_STEP,4)
    }


}
